home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Games / NeXTmj / Source / GameInterface.h < prev    next >
Text File  |  1991-03-18  |  2KB  |  80 lines

  1.  
  2. /*
  3.  * This class is an interface between the Objective-C GUI
  4.  *    interface and two of the game's key objects,  the Tile Count Manager
  5.  *    and Game Coordinator.
  6.  *
  7.  * The source file is an Objective-C object but must be
  8.  *    compiled with cc++.  It is the hack file.
  9.  *
  10.  *
  11.  $Author$
  12.  $Header$
  13.  *
  14.  $Log$
  15.  */
  16.  
  17.  
  18. #import <objc/Object.h>
  19. #import    <appkit/Window.h>
  20.  
  21. #import    "GameBoardView.h"
  22. #import    "TileCountView.h"
  23.  
  24.  
  25. @interface GameInterface:Object
  26. {
  27.                                                 // These variables are outlets.
  28.                                                 //    They include the game window
  29.                                                 //    and two views that display tiles.
  30.     Window*            window;
  31.     GameBoardView*    gameBoardView;
  32.     TileCountView*    tileCountView;
  33.                                                 // These are actually C++ objects.
  34.                                                 //    They are casted from void* type
  35.                                                 //    to their respective object when
  36.                                                 //    accesses.  
  37.                                                 // This is done because this header
  38.                                                 //    file is compiled with the Objective-C
  39.                                                 //    compiler and the source is compiled 
  40.                                                 //    with the C++.
  41.     void            *gameCoordinator,
  42.                     *tileCountManager;
  43.                                                 // This flag is used to prevent draw messages
  44.                                                 //    from being sent to the C++ object before
  45.                                                 //    the application has finished initializing.
  46.     BOOL            application_initialized;
  47. }
  48.  
  49.                                                 // This is the designated initializer
  50.                                                 //    for this class.  This method creates
  51.                                                 //    the Game Coordinator which sets off
  52.                                                 //    a chain reaction of object creation.
  53. - init;
  54. - free;
  55.                                                 // This object is the delegate of the 
  56.                                                 //    application.  This method completes
  57.                                                 //    the initialization by creating the
  58.                                                 //    Tile Count Manager and Game Coordinator.
  59. - appDidInit:sender;
  60.                                                 // These methods are targets of buttons 
  61.                                                 //    and views.  The interface translates
  62.                                                 //    the Objective-C calls to C++ calls of
  63.                                                 //    the apprpriate object.
  64. - undoClick:sender;
  65. - helpClick:sender;
  66. - againClick:sender;
  67. - newClick:sender;
  68.                                                 // These are interface methods
  69.                                                 //    between the Game Board's
  70.                                                 //    view and the Game Coordinator.
  71. - gameBoardDraw;
  72. - click:( const NXPoint * )aPoint;
  73. - doubleClick:( const NXPoint * )aPoint;
  74.                                                 // These are interface methods
  75.                                                 //    between the Time Count's view
  76.                                                 //    and the Tile Count Manager.
  77. - tileCountDraw;
  78.  
  79. @end
  80.